home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / DJGPP / DJSRC111.ZIP / go32 / dpmi.h < prev    next >
C/C++ Source or Header  |  1993-08-29  |  2KB  |  68 lines

  1. /* original Copyright(C) 1992 Hiroya Tsubakimoto
  2.  * modifications Copyright(C) 1993 Charles Sandmann
  3.  * Merged with GO32 V1.09+ C. Sandmann sandmann@clio.rice.edu
  4.  * Distributed under terms of "copying.dj" when distributed with GO32 source
  5.  * Distributed under terms of GPL if used in any other code  */
  6.  
  7. typedef struct {
  8.   struct {
  9.     word8 minor, major;
  10.   } version;
  11.   word16 flags;
  12.   word16 cpu;
  13.   struct {
  14.     word8 slave, master;
  15.   } PIC;
  16. } DPMIinfo;
  17.  
  18. typedef struct {
  19.   word32 address;
  20.   word32 bytes;
  21.   word32 handle;
  22. } DPMImemory;
  23.  
  24. typedef struct {
  25.   word32 offset;
  26.   word16 selector;
  27. } DPMIaddress;
  28.  
  29. typedef struct {
  30.   word32 largest_block;
  31.   word32 physical_mem;
  32.   word32 swap_mem;
  33. } DPMImaxmeminfo;
  34.  
  35. extern int exitDPMI;
  36. extern char use_DPMI;
  37.  
  38. /* real mode function(s) */
  39. int initDPMI(DPMIinfo* info);
  40. void DPMIprotectedMode(void);
  41. int DPMIexecute(void);
  42.  
  43. int DPMIsetBreak(word16 sizetype, word32 addr);
  44. int DPMIcancelBreak(int handle);
  45.  
  46. void Pmemget(word16 sel, word32 off, void* addr, word16 bytes);
  47. void Pmemput(word16 sel, word32 off, const void* addr, word16 bytes);
  48. void Pmemset(word16 sel, word32 off, word8 value, word32 bytes);
  49. word16 Pmemscan(word16 sel, word32 off, word8 value, word16 bytes);
  50.  
  51. /* protected mode function(s) */
  52. void uninitDPMI(int retcode);
  53. void DPMIrealMode(void);
  54. void DPMImaxmem(DPMImaxmeminfo*);
  55. int DPMIalloc(DPMImemory* mem, word32 bytes);
  56. int DPMIrealloc(DPMImemory* mem, word32 bytes);
  57. void DPMIfree(DPMImemory* mem);
  58. word16 DPMIselector(word16 number);
  59. int DPMIassignSelector(word16 selector, word16 type, word32 base, word32 limit);
  60. int DPMISelectorBase(word16 selector, word32 base);
  61. void DPMIchangeException(word8 no, DPMIaddress* handler);
  62. void DPMIchangeInterrupt(word8 no, DPMIaddress* handler);
  63. void DPMIhandler(word8 no, DPMIaddress* handler);
  64. void DPMIehandler(word8 no, DPMIaddress* handler);
  65. void DPMIhandlerNPX(DPMIaddress* handler);
  66.  
  67. #define exit(n) ( exit(exitDPMI=(n)) )
  68.